import { api, javaApi } from './root'
import request from './request'

// 轮播图
export const getBannerList = (data) => {
    return request.get(`${javaApi}/fronttop/list`, data);
}

// 职位列表
export const getSearchList = (data) => {
    return request.get(`${api}/employ/index.php?mode=index&doaction=index&detail=list`, data);
}

// 最新发布
export const getPostList = (data) => {
    return request.get(`${api}/myNew/home_nologin_h5.php?detail=new_job`, data);
}

// 热门职位
export const getHotList = (data) => {
    return request.get(`${api}/myNew/home_nologin_h5.php?detail=hot_job`, data);
}

// AI荐岗
export const getAiList = (data) => {
    return request.get(`${api}/myNew/home_h5.php?mode=job&detail=ajax`, data);
}

// 我的收藏
export const getCollectList = (data) => {
    return request.get(`${api}/myNew/home_h5.php?mode=job&detail=favorite`, data);
}

// 消息列表
export const getNewList = (data) => {
    return request.get(`${api}/myNew/home_h5.php?mode=job&detail=news`, data);
}

// 消息标记已读
export const markRead = (data) => {
    return request.get(`${api}/myNew/home_h5.php?mode=job&detail=news_click`, data);
}

// 政策法规
export const getregulationsList = (data) => {
    data = {
        ...data,
        mode: 'index',
        doaction: 'zc',
        detail: "list",
    };
    return request.get(`${api}/mva/index.php`, data)
}

// 登录
export const login = (data) => {
    return request.post(`${api}/personServe/CheckUserAjax.php?ajaxformflag=1`, data);
}

// 求职个人会员在线咨询
export const onlineConsultation = (data) => {
    return request.post(`${api}/channel/advice/deal?ajaxformflag=1`, data);
}

// 获取文章列表（最新资讯、现场招聘）
export const getArticleList = (data) => {
    data = {
        ...data,
        mode: 'index',
        doaction: 'article',
        detail: "list",
    };
    return request.get(`${api}/employ/index.php`, data)
}

// 获取文章详情
export const getArticleDetailt = (data) => {
    data = {
        ...data,
        mode: 'index',
        doaction: 'article',
        detail: "detail",
    }
    return request.get(`${api}/employ/index.php`, data)
}

// 获取用户信息
export const getUserInfo = (data) => {
    data = {
        ...data,
        mode: 'index',
        doaction: 'index',
        detail: "getUserInfo",
    }
    return request.get(`${api}/employ/index.php`, data)
}